﻿(function ($) {
    $.fn.edittable = function (options, param) {
        var attrMandatory;
        options = options || {};
        return this.each(function () {
            //debugger;
            $(this).find("td:even").each(function (i, n) {
                n.align = "right";
                attrMandatory = $(n).attr("required");
                if (attrMandatory != undefined) {
                    $(n).append("<span style='color:red'>*</span>");
                }
                //$(n).append("：");
                $(n).css({ "background-color": "#F5F5F8", "font-weight": "bold", "width": "150px" });
            });
            $(this).find("td:odd").each(function (i, n) {
                n.align = "left";
            });
            $(this).css({ "border-width": "1px" });
            if ($(this).attr("enabled") == "false") {
                $(this).find("input,select").each(function (i, n) {
                    $(n).attr("disabled", true);
                });
            }
        });
    };
})(jQuery);